<template>
  <div>
    <div class="page_tab_top">
      <div
        class="tab_list_item"
        @click="cutTab(1)"
        :class="currentIndex === 1 ? 'tab_active' : ''"
      >
        档位变化
      </div>
      <div
        class="tab_list_item"
        @click="cutTab(2)"
        :class="currentIndex === 2 ? 'tab_active' : ''"
      >
        档位统计
      </div>
      <div
        class="tab_list_item"
        @click="cutTab(3)"
        :class="currentIndex === 3 ? 'tab_active' : ''"
      >
        档位变化统计
      </div>
    </div>
    <GearChanges
      ref="GearChanges"
      v-show="this.currentIndex === 1"
    ></GearChanges>
    <GearTotal ref="GearTotal" v-show="this.currentIndex === 3"></GearTotal>
    <GearChangeTotal
      ref="GearChangeTotal"
      v-show="this.currentIndex === 2"
    ></GearChangeTotal>
  </div>
</template>
      
<script>
import GearChanges from "./GearChanges.vue";
import GearTotal from "./GearChangeTotal.vue";
import GearChangeTotal from "./GearTotal.vue";

export default {
  components: {
    GearChanges,
    GearTotal,
    GearChangeTotal,
  },
  name: "Eryuoadisposition",

  data() {
    return {
      currentIndex: 1,
    };
  },

  mounted() {
    this.$nextTick(() => {
      this.changeChild();
    });
  },

  methods: {
    //  // 顶部tab切换
    cutTab(i) {
      this.currentIndex = i;
      this.changeChild();
    },

    changeChild() {
      if (this.currentIndex === 1) {
        this.$refs.GearChanges.resQ();
      } else if (this.currentIndex === 2) {
        this.$refs.GearTotal.resQ();
      } else if (this.currentIndex === 3) {
        this.$refs.GearChangeTotal.resQ();
      }
    },
  },
};
</script>
      
<style lang="scss" scoped>
</style>